package com.zyzd.general.model;

import com.zyzd.commontools.dialog.TipDialog;
import com.zyzd.general.R;
import com.zyzd.general.entity.local.ManagerListEntity;
import com.zyzd.general.entity.local.TipDialogEntity;
import com.zyzd.general.module.card.CardViewFragment;
import com.zyzd.general.module.change_app_name.ChangeAppNameFragment;
import com.zyzd.general.module.coordinatorlayout.CoordinatorLayoutFragment;
import com.zyzd.general.module.countdown.CountDownFragment;
import com.zyzd.general.module.drawabletest.DrawableTestFragment;
import com.zyzd.general.module.drawerlayout.DrawerLayoutFragment;
import com.zyzd.general.module.managerlist.ManagerListFragment;
import com.zyzd.general.module.notification.NotificationFragment;
import com.zyzd.general.module.recyclerview.edit.EditRecyclerFragment;
import com.zyzd.general.module.recyclerview.layoutmanager.TestLayoutManagerFragment;
import com.zyzd.general.module.recyclerview.slidebar.SidebarRecyclerFragment;
import com.zyzd.general.module.recyclerview.test.TestFragment;
import com.zyzd.general.module.recyclerview.textfragment.TextFragment;
import com.zyzd.general.module.tablayout.FragmentTabHost2Fragment;
import com.zyzd.general.module.tablayout.FragmentTabHostFragment;
import com.zyzd.general.module.tablayout.TabLayoutFragment;
import com.zyzd.general.module.tipdialog.TipDialogFragment;

import java.util.ArrayList;

/**
 * Created by lzy on 2018/5/15 0015.
 * description ${管理列表 Model}
 */
public class ManagerListModel {
    private ManagerListModel() {
    }

    private static ManagerListModel mModel = new ManagerListModel();

    public static ManagerListModel getInstance() {
        return mModel;
    }

    public ArrayList<ManagerListEntity> getData(String dataTag) {
        switch (dataTag) {
            case DATA_TAG_MAIN:
                return getMainList();
            case DATA_TAG_TEST_RECYCLER_VIEW:
                return getRecyclerViewListData();
            case DATA_TAG_TEST_TAB_HOME:
                return getTabLayoutData();
            default:
                return new ArrayList<>();
        }
    }


    public static final String DATA_TAG_MAIN = "Main";

    public ArrayList<ManagerListEntity> getMainList() {
        ArrayList<ManagerListEntity> list = new ArrayList<>();
        list.add(new ManagerListEntity("RecyclerView", ManagerListFragment.getInstance(DATA_TAG_TEST_RECYCLER_VIEW)));
//        list.add(new ManagerListEntity("DialogFragment", MyDialogFragment.getInstance()));
        list.add(new ManagerListEntity("CardView", CardViewFragment.getInstance()));
        list.add(new ManagerListEntity("Notification", NotificationFragment.getInstance()));
        list.add(new ManagerListEntity("TabLayout", ManagerListFragment.getInstance(DATA_TAG_TEST_TAB_HOME)));
        list.add(new ManagerListEntity("CountDown", new CountDownFragment()));
        list.add(new ManagerListEntity("CoordinatorLayout", CoordinatorLayoutFragment.getInstance()));
        list.add(new ManagerListEntity("TipDialog", TipDialogFragment.getInstance()));
        list.add(new ManagerListEntity("DrawerLayout", DrawerLayoutFragment.getInstance()));
        list.add(new ManagerListEntity("ChangeAppName", ChangeAppNameFragment.getInstance()));
        list.add(new ManagerListEntity("drawableTest", DrawableTestFragment.getInstance()));
        return list;
    }

    public static final String DATA_TAG_TEST_RECYCLER_VIEW = "TestRecyclerView";

    public ArrayList<ManagerListEntity> getRecyclerViewListData() {
        ArrayList<ManagerListEntity> list = new ArrayList<>();
        list.add(new ManagerListEntity("LayoutManager", TestLayoutManagerFragment.getInstance()));
        list.add(new ManagerListEntity("复杂的Recycler列表", new TestFragment()));
        list.add(new ManagerListEntity("带有快速索引的Recycler", SidebarRecyclerFragment.getInstance()));
        list.add(new ManagerListEntity("自动换行测试", TextFragment.getInstance()));
        list.add(new ManagerListEntity("输入框条目的recycler", EditRecyclerFragment.getInstance()));
        return list;
    }

    public static final String DATA_TAG_TEST_TAB_HOME = "TestTabHome";

    public ArrayList<ManagerListEntity> getTabLayoutData() {
        ArrayList<ManagerListEntity> list = new ArrayList<>();
        list.add(new ManagerListEntity("Test_FragmentTabHost", new FragmentTabHostFragment()));
        list.add(new ManagerListEntity("Test_FragmentTabHost2", new FragmentTabHost2Fragment()));
        list.add(new ManagerListEntity("Test_TabLayout", new TabLayoutFragment()));
        return list;
    }

    public ArrayList<TipDialogEntity> getTipDialogData() {
        ArrayList<TipDialogEntity> list = new ArrayList<>();
        list.add(new TipDialogEntity("正在加载", "加载类型提示框", TipDialog.Builder.ICON_TYPE_LOADING));
        list.add(new TipDialogEntity("发送成功", "成功提示类型提示框", TipDialog.Builder.ICON_TYPE_SUCCESS));
        list.add(new TipDialogEntity("发送失败", "失败提示类型提示框", TipDialog.Builder.ICON_TYPE_FAIL));
        list.add(new TipDialogEntity("", "单独图片类型提示框", TipDialog.Builder.ICON_TYPE_SUCCESS));
        list.add(new TipDialogEntity("请勿重复操作", "单独文字类型提示框", TipDialog.Builder.ICON_TYPE_NOTHING));
        list.add(new TipDialogEntity("", "自定义内容提示框", TipDialog.Builder.ICON_TYPE_NOTHING, R.layout.dialog_custom));
        return list;
    }


}
